ft<-'AFP'
p2.1<-ggplot(data = expr.ft)+geom_boxplot(aes(x=celltype,y=expr,color=celltype),size=1)+
  scale_color_manual(values = pal1)+theme_light()+labs(y=ft)+
  theme(axis.title.x = element_blank(),axis.text.x = element_text(angle = 45,hjust = 1,vjust = 1),legend.position = 'none')
p2.1
expr.ft1<-group_by(expr.ft,celltype)
expr.ft1<-summarise(expr.ft1,AvgExpr = mean(expr[expr>0]),Freq = length(expr[expr>0])/length(expr))
expr.ft1<- expr.ft1 %>% mutate(gene = ft) %>% as.data.frame()
p2.2<-ggplot(data=expr.ft1,aes(x=celltype,y=gene))+geom_point(aes(size = Freq,color = AvgExpr))+
  scale_color_gradient(low="lightgrey",high="blue")+theme_light()+theme(panel.grid.major  = element_blank())+
  theme(axis.title = element_blank(),axis.ticks = element_blank(),axis.text = element_blank(),legend.position = 'none')
p2<-p2.2/p2.1+plot_layout(heights = c(1,8))
pdf('sc_gene_expr.pdf',width = 8,height = 6)
print(p2)
dev.off()
